package cn.wolfcode.p2p.base.domain;

import cn.wolfcode.p2p.base.util.Constants;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
public class IpLog extends BaseDomain {

    public static final int STATE_FAILED = 0;//登陆失败状态

    public static final int STATE_SUCCESS = 1;//登陆成功状态

    private String username;//登陆用户

    private Date loginTime;//登陆时间

    private String ip;//来源IP

    private int state;//登陆状态

    private int userType;//用户类型

    public String getStateDisPlay() {
        return this.state == STATE_SUCCESS ? "登录成功" : "登录失败";
    }

    public String getUserTypeDisplay(){
        return this.userType == LoginInfo.USERTYPE_ADMIN ? "管理员" : "前端用户";
    }
}
